//
//  bottomTableViewCell.m
//  ioschishan
//
//  Created by 千翼网络科技 on 2017/7/12.
//  Copyright © 2017年 qianyi. All rights reserved.
//

#import "bottomTableViewCell.h"

@implementation bottomTableViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    
    if (self = [super initWithStyle:style reuseIdentifier:@"bottomTableViewCell"]) {
        
        [self initView];
    }
    return self;
}

#pragma mark ---------------- init -----------------

- (void)initView{

    self.backgroundColor = getColor(@"ffffff");
    
    _leftImg = [[UIImageView alloc]init];
    _leftImg.image = [UIImage imageNamed:@"3479.jpg_wh1200"];
    [self addSubview:_leftImg];
    [_leftImg mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(self.contentView).with.offset(screenScale(15));
        make.left.mas_equalTo(self).with.offset(screenScale(15));
        make.width.mas_equalTo(screenScale(173));
        make.height.mas_equalTo(screenScale(130));
    }];
    
    _nameLable = [[UILabel alloc]init];
    _nameLable.text = @"孩子们总是在不经意间感动你";
    _nameLable.numberOfLines = 2;
    _nameLable.textColor = getColor(@"333333");
    _nameLable.textAlignment = NSTextAlignmentLeft;
    _nameLable.font = get4sFont(11);
    [self addSubview:_nameLable];
    [_nameLable mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(self).with.offset(screenScale(15));
        make.left.mas_equalTo(self).with.offset(screenScale(203));
        make.right.mas_equalTo(self).with.offset(screenScale(-15));
        
    }];
    
    _textLable = [ConfigXp labelWithFrame:CGRectZero
                                     text:@"转眼间，清明已过，漠北寒风呼呼，大雪泠冽，金戈铁马，半壁荒原，又一个冬天到了，冬天到了."
                                textColor:getColor(@"9b9b9b")
                                     font:get4sFont(10)
                            textAlignment:NSTextAlignmentLeft
                          backgroundColor:[UIColor clearColor]];
    _textLable.numberOfLines = 3;
    [self addSubview:_textLable];
    [_textLable mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(self).with.offset(screenScale(59));
        make.left.mas_equalTo(self).with.offset(screenScale(203));
        make.right.mas_equalTo(self).with.offset(screenScale(-15));
        
    }];
    
    _progressView = [[UIProgressView alloc]initWithProgressViewStyle:UIProgressViewStyleDefault];
    _progressView.trackTintColor = getColor(@"dddddd");
    _progressView.progressTintColor = getColor(@"8cd81a");
    _progressView.progress = 1/1;
//    [_progressView setProgress:y/z animated:YES];
    [self addSubview:_progressView];
    [_progressView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(self).with.offset(screenScale(132));
        make.left.mas_equalTo(self).with.offset(screenScale(203));
        make.width.mas_equalTo(screenScale(120));
        make.height.mas_equalTo(screenScale(3));
    }];
    
    _progressLable = [ConfigXp labelWithFrame:CGRectZero
                                     text:@"75%"
                                textColor:getColor(@"8cd81a")
                                     font:get4sFont(9)
                            textAlignment:NSTextAlignmentLeft
                          backgroundColor:[UIColor clearColor]];
    [self addSubview:_progressLable];
    [_progressLable mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(self).with.offset(screenScale(126));
        make.right.mas_equalTo(self).with.offset(screenScale(-15));
        
    }];
    
    _headImg = [[UIImageView alloc]init];
    _headImg.layer.cornerRadius = screenScale(10);
    _headImg.layer.masksToBounds = YES;
    _headImg.image = [UIImage imageNamed:@"图层-19"];
    [self addSubview:_headImg];
    [_headImg mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(self).with.offset(screenScale(155));
        make.left.mas_equalTo(self).with.offset(screenScale(15));
        make.width.mas_equalTo(screenScale(20));
        make.height.mas_equalTo(screenScale(20));
    }];
    
    _personLable = [ConfigXp labelWithFrame:CGRectZero
                                         text:@"没有人先生"
                                    textColor:getColor(@"9b9b9b")
                                         font:get4sFont(9)
                                textAlignment:NSTextAlignmentLeft
                              backgroundColor:[UIColor clearColor]];
    [self addSubview:_personLable];
    [_personLable mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(self).with.offset(screenScale(160));
        make.left.mas_equalTo(self).with.offset(screenScale(40));
        
    }];
    
    ///
    
    _moneyImg = [[UIImageView alloc]init];
    _moneyImg.image = [UIImage imageNamed:@"money_icon"];
    [self addSubview:_moneyImg];
    [_moneyImg mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(self).with.offset(screenScale(157));
        make.left.mas_equalTo(self).with.offset(screenScale(161));
        make.width.mas_equalTo(screenScale(18));
        make.height.mas_equalTo(screenScale(18));
    }];
    
    _moneyLable = [ConfigXp labelWithFrame:CGRectZero
                                       text:@"50000"
                                  textColor:getColor(@"9b9b9b")
                                       font:get4sFont(10)
                              textAlignment:NSTextAlignmentLeft
                            backgroundColor:[UIColor clearColor]];
    [self addSubview:_moneyLable];
    [_moneyLable mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(self).with.offset(screenScale(160));
        make.left.mas_equalTo(self).with.offset(screenScale(186));
        
    }];
    
    ///
    
    _peopleImg = [[UIImageView alloc]init];
    _peopleImg.image = [UIImage imageNamed:@"number_icon"];
    [self addSubview:_peopleImg];
    [_peopleImg mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(self).with.offset(screenScale(155));
        make.left.mas_equalTo(self).with.offset(screenScale(232));
        make.width.mas_equalTo(screenScale(20));
        make.height.mas_equalTo(screenScale(20));
    }];
    
    _peopleLable = [ConfigXp labelWithFrame:CGRectZero
                                      text:@"2153人"
                                 textColor:getColor(@"9b9b9b")
                                      font:get4sFont(10)
                             textAlignment:NSTextAlignmentLeft
                           backgroundColor:[UIColor clearColor]];
    [self addSubview:_peopleLable];
    [_peopleLable mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(self).with.offset(screenScale(160));
        make.left.mas_equalTo(self).with.offset(screenScale(257));
        
    }];
    
    ///
    
    _dayImg = [[UIImageView alloc]init];
    _dayImg.image = [UIImage imageNamed:@"time_icon"];
    [self addSubview:_dayImg];
    [_dayImg mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(self).with.offset(screenScale(155));
        make.left.mas_equalTo(self).with.offset(screenScale(308));
        make.width.mas_equalTo(screenScale(20));
        make.height.mas_equalTo(screenScale(20));
    }];
    
    _dayLable = [ConfigXp labelWithFrame:CGRectZero
                                       text:@"23天"
                                  textColor:getColor(@"9b9b9b")
                                       font:get4sFont(10)
                              textAlignment:NSTextAlignmentLeft
                            backgroundColor:[UIColor clearColor]];
    [self addSubview:_dayLable];
    [_dayLable mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(self).with.offset(screenScale(160));
        make.left.mas_equalTo(self).with.offset(screenScale(333));
        make.right.mas_equalTo(self).with.offset(0);
    }];
    
    ///
    
    _threadView = [[UIView alloc]init];
    _threadView.backgroundColor = getColor(@"e6e6e6");
    [self addSubview:_threadView];
    [_threadView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.bottom.mas_equalTo(self).with.offset(0);
        make.left.mas_equalTo(self).with.offset(0);
        make.width.mas_equalTo(scrWidth());
        make.height.mas_equalTo(screenScale(1));
    }];
}

@end
